package com.molichuxing.gateway.bff.order.services;

import com.molichuxing.framework.dto.Paged;
import com.molichuxing.framework.exception.BizException;
import com.molichuxing.framework.service.RootService;
import com.molichuxing.gateway.bff.order.entity.request.create.PaymentOfflineCreateVo;
import com.molichuxing.gateway.bff.order.entity.response.*;
import com.molichuxing.services.property.OfflineRepayTypeEnum;

import java.util.List;
import java.util.Map;

/**
 * 订单排期相关bff
 * 
 * @author zoumingyu
 * @date 2019年8月23日
 *
 */
public interface OrderScheduleBffService extends RootService {

	/**
	 * 分页获取专属里程订单还款计划信息
	 * 
	 * @param params
	 *            orderCode：订单号-long <br />
	 *            userRealName：用户姓名-string <br />
	 *            userPhone：用户手机号-string <br />
	 * @param pageNum
	 *            页数
	 * @param pageSize
	 *            每页条数
	 * @return
	 * @throws Exception
	 */
	public Paged<OrderRepaymentVo> getExclusivelOrderCurrentPeriod(Map<String, Object> params, int pageNum,
			int pageSize) throws Exception;

	/**
	 * 分页获取专属里程订单逾期管理
	 * 
	 * @param params
	 *            orderCode：订单号-long <br />
	 *            userRealName：用户姓名-string <br />
	 *            userPhone：用户手机号-string <br />
	 * @param pageNum
	 *            页数
	 * @param pageSize
	 *            每页条数
	 * @return
	 * @throws Exception
	 */
	public Paged<OrderOverdueVo> getExclusivelOrderOverdue(Map<String, Object> params, int pageNum, int pageSize)
			throws Exception;

	/**
	 * 查询还款计划明细
	 *
	 * @param orderCode 订单号
	 * @param overdue   是否只查询已逾期
	 * @return
	 */
	public List<OrderRepaymentDetailVo> getRepaymentDetail(Long orderCode, boolean overdue);

	/**
	 * 获取经销商订单本期还款列表 - 还款计划
	 * @param params
	 * @param pageNum
	 * @param pageSize
	 * @return
	 */
	Paged<OrderScheduleCurrentPeriodVo> getOrderScheduleCurrentPeriodList(Map<String, Object> params, Integer pageNum, Integer pageSize) throws Exception;


	/**
	 * 获取经销商订单逾期未还款列表 - 逾期未还款
	 * @param params
	 * @param pageNum
	 * @param pageSize
	 * @return
	 */
	Paged<OrderScheduleOverdueVo> getOrderScheduleOverdueList(Map<String, Object> params, Integer pageNum, Integer pageSize) throws Exception;

	/**
	 * 获取线下支付信息
	 * 
	 * @param selectParams
	 * @param pageNum
	 *            页数
	 * @param pageSize
	 *            每页条数
	 * @return
	 * @throws Exception
	 */
	public Paged<PaymentOfflineVo> getPaymentOfflinePage(Map<String, Object> selectParams, Integer pageNum, Integer pageSize)
			throws Exception;


	/**
	 * 根据线下支付id获取订单排期信息
	 * 
	 * @param offlineId
	 *            线下支付id
	 * @return
	 * @throws Exception
	 */
	public PaymentOfflineVo getPaymentOfflineFlow(Integer offlineId) throws Exception;

	/**
	 * 获取线下支付订单排期信息
	 * 
	 * @param offlineId
	 *            线下支付id
	 * @param repayType
	 *            线下支付类型
	 * @return
	 * @throws Exception
	 */
	public List<PaymentOfflineScheduleVo> getPaymentOfflineSchedule(Integer offlineId, OfflineRepayTypeEnum repayType)
			throws Exception;

	/**
	 * 获取线下支付审核信息
	 * 
	 * @param offlineId
	 *            线下支付id
	 * @return
	 * @throws Exception
	 */
	public PaymentOfflineAuditVo getPaymentOfflineAudit(Integer offlineId) throws Exception;

	/**
	 * 线下支付流水编号是否存在
	 * 
	 * @param serialNumber
	 *            流水编号
	 * @return
	 */
	public Boolean getSerialNumberExists(String serialNumber) throws IllegalArgumentException, Exception;

	/**
	 * 经销商订单支付未还款排期
	 * 
	 * @param orderCode
	 *            订单号
	 * @return
	 * @throws Exception
	 */
	public List<OrderScheduleRelationVo> getOrderScheduleRelationBizDto(Long orderCode) throws Exception;

	/**
	 * 用户订单支付未还款排期
	 * 
	 * @param orderCode
	 *            订单号
	 * @return
	 * @throws Exception
	 */
	public List<OrderRepaymentDetailVo> getOrderUserScheduleNoRepay(Long orderCode) throws Exception;

	/**
	 * 线下支付查询未还款排期
	 * 
	 * @param orderCode
	 * @return
	 * @throws Exception
	 */
	public List<OrderRepaymentDetailVo> getOrderUserScheduleNoRepayOffline(Long orderCode) throws Exception;

	/**
	 * 订单线下支付新增
	 * 
	 * @param createVo
	 *            新增vo
	 * @return
	 * @throws Exception
	 */
	public Boolean createOrderPaymentOffline(PaymentOfflineCreateVo createVo) throws BizException, Exception;
}
